package com.dangdi.service;

import com.dangdi.dao.Dao;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("ImportBookService")
@Transactional
public class ImportBookService {
    @Resource
    private Dao dd;

    public List<Map<String, Object>> test() {
        return dd.test();
    }

    public void insertBokk(String code, String rfid) {
        dd.insertBokk(code, rfid, new Date());
    }

    public List<Map<String, Object>> checkCodeAndRfid(String code, String rfid) {
        return dd.checkCodeAndRfid(code, rfid);
    }

    public int getAllcount() {
        return dd.getAllcount();
    }

    public int getTodayCount() {
        return dd.getTodayCount();
    }

    public List<Map<String, Object>> checkCode(String code) {
        return dd.checkCode(code);
    }

    public List<Map<String, Object>> checkRfid(String rfid) {
        return dd.checkRfid(rfid);
    }

    public void quChongBookEnd() {
        dd.quChongBookEnd();
    }

    public void quChong() {
        dd.quChong();
    }

    public void quChongCode() {
        dd.quChongCode();
    }

    public void quChongRfid() {
        dd.quChongRfid();
    }

    public void UpdateByCode(@Param("code") String code, @Param("rfid") String rfid) {
        dd.UpdateByCode(code, rfid, new Date());
    }

    public void UpdateByRfid(@Param("code") String code, @Param("rfid") String rfid) {
        dd.UpdateByRfid(code, rfid, new Date());
    }

    public List<Map<String, Object>> checkRepeat() {
        return dd.checkRepeat();
    }

    public List<Map<String, Object>> checkCodeLength() {
        return dd.checkCodeLength();
    }

    public List<Map<String, Object>> checkRepeatCode() {
        return dd.checkRepeatCode();
    }

    public List<Map<String, Object>> checkRepeatRfid() {
        return dd.checkRepeatRfid();
    }

    public Map<String, Object> getOneReaderForNotReaderCardID() {
        return dd.getOneReaderForNotReaderCardID();
    }

    public int updateReaderByReader_id(Map reader) {
        System.out.println(reader);
        return dd.updateReaderByReader_id(reader);
    }

    public int AllReaderCount() {
        return dd.AllReaderCount();
    }

    public int updatedReaderCount() {
        return dd.updatedReaderCount();
    }

    public int NotUpdatedReaderCount() {
        return dd.NotUpdatedReaderCount();
    }

    //获取角色列表
    public List<Map<String, Object>> readerRoleList() {
        return dd.readerRoleList();
    }

    //状态列表
    public List<Map<String, Object>> readerStatusList() {
        return dd.readerStatusList();
    }

    //查询m1卡号
    public int checkReader_rfid(String reader_rfid) {
        return dd.checkReader_rfid(reader_rfid);
    }

    //excel
    public int insertExlUpload(String school, String tag) {
        System.out.println(school);
        System.out.println(tag);
        return dd.insertExlUpload(school, tag);
    }

    //school
    public List<String> getSchoolList() {
        return dd.getSchoolList();
    }

    public List<String> getTagListBySchool(String school) {
        return dd.getTagListBySchool(school);
    }

    public String findBookNameByBook_rfid(String book_rfid) {
        return dd.findBookNameByBook_rfid(book_rfid);
    }

    public int insertBookShelfAndBook(String school, String tag, String book, String cengRFID, String code) {
        return dd.insertBookShelfAndBook(school, tag, book, cengRFID, code);
    }

    public int deleteBookSheflByBookRfid(String book) {
        return dd.deleteBookSheflByBookRfid(book);
    }

    public int checkBookShelfAndBook(String book) {
        return dd.checkBookShelfAndBook(book);
    }

    public String findBookBarCodeByBook_rfid(@Param("book_rfid") String book_rfid) {
        return dd.findBookBarCodeByBook_rfid(book_rfid);
    }

    public int insertBookLocation(@Param("weizhima") String weizhima, @Param("rfid") String rfid, @Param("shujia") String shujia, @Param("cengwei") String cengwei, @Param("lie") String lie, @Param("code") String code) {
        System.out.println("weizhima=" + weizhima);
        System.out.println("rfid=" + rfid);
        System.out.println("shujia=" + shujia);
        System.out.println("cengwei=" + cengwei);
        System.out.println("lie=" + lie);
        System.out.println("code=" + code);
        return dd.insertBookLocation(weizhima, rfid, shujia, cengwei, lie, code, shujia + lie + cengwei);
    }

    public int getBookLocationRfidCountByRfid(@Param("rfid") String rfid) {
        return dd.getBookLocationRfidCountByRfid(rfid);
    }

    public int getBookLocationRfidCountByCode(@Param("code") String code) {
        return dd.getBookLocationRfidCountByCode(code);
    }

    public int getBookLocationAllCount() {
        return dd.getBookLocationAllCount();
    }

    public int getBookLocationTodayCount() {
        return dd.getBookLocationTodayCount();
    }

    public Map<String, Object> book_end_infoByRfid(@Param("rfid") String rfid) {
        return dd.book_end_infoByRfid(rfid);
    }

    public int inserPachongdate(@Param("manufacturer") String manufacturer, @Param("model") String model, @Param("engine_type") String engine_type, @Param("engine_power") String engine_power, @Param("product_total_lub_1") String product_total_lub_1, @Param("product_total_lub_2") String product_total_lub_2, @Param("product_total_transmission") String product_total_transmission, @Param("productDetail") String productDetail, @Param("title") String title, @Param("itenm") String itenm) {
        return dd.inserPachongdate(manufacturer, model, engine_type, engine_power, product_total_lub_1, product_total_lub_2, product_total_transmission, productDetail, title, itenm);
    }

    public List<Map<String, Object>> getJson() {
        return dd.getJson();
    }

    public List<String> getManufacturer() {
        return dd.getManufacturer();
    }

    public List<String> getModel(String name) {
        return dd.getModel(name);
    }

    public List<String> getEngine_type(String s, String s1) {
        return dd.getEngine_type(s, s1);
    }

    public List<String> getEngine_power(String s, String s1) {
        return dd.getEngine_power(s, s1);
    }

    public Map<String, Object> getDataByFourParam(String s, String s1, String s2) {
        return dd.getDataByFourParam(s, s1, s2);
    }

    public void InsertPC(String name, String s, String salesName, String s1, String levelId, String filling, String high, String lower) {
        dd.InsertPC(name,s,salesName,s1,levelId,filling,high,lower);
    }

    public int insertYou(String manufacturer, String model, String engine_power, String biansu) {
        return dd.insertYou(manufacturer,model,engine_power,biansu);
    }
}
